package legumes.client.services;

import java.util.Collection;
import java.util.List;

import legumes.shared.domain.Customer;
import legumes.shared.domain.CustomerDTO;
import legumes.shared.domain.CustomerRole;
import legumes.shared.domain.LatLng;
import legumes.shared.domain.NewProductMarket;
import legumes.shared.domain.Order;
import legumes.shared.domain.Product;
import legumes.shared.domain.ProductCategory;
import legumes.shared.domain.ProductVariety;
import legumes.shared.domain.SellSession;
import legumes.shared.domain.SellSessionForCustomer;
import legumes.shared.domain.Stall;
import legumes.shared.domain.Store;

import com.google.gwt.user.client.rpc.AsyncCallback;

public interface LegumesServicesAsync {
	public void parseStallMail(String mailContent_,
			AsyncCallback<Stall> callback_);

	public void isStoreOpened(AsyncCallback<Boolean> callback_);

	public void setStoreOpened(boolean b_, AsyncCallback<Void> callback_);

	public void getMessageStore(AsyncCallback<String> callback_);

	public void setMessageStore(String message_, AsyncCallback<Void> callback_);

	public void getCustomer(String name_, AsyncCallback<Customer> callback_);

	public void getProducts(AsyncCallback<List<Product>> callback_);

	public void log(String login_, String password_,
			AsyncCallback<String> callback_);

	public void unlog(AsyncCallback<Void> callback_);

	public void whoAmI(AsyncCallback<CustomerDTO> callback_);

	public void getSellSession(long date_, AsyncCallback<SellSession> callback_);

	public void getOpenedSellSessionId(AsyncCallback<Long> callback_);

	public void getSellSessionsDate(AsyncCallback<List<Long>> callback_);

	public void getSellSessionForCustomer(
			AsyncCallback<SellSessionForCustomer> callback_);

	void newSellSession(Store store_, long fromSellSessionId_,
			AsyncCallback<SellSession> callback_);

	public void save(long sellSessionId_, Order order_, boolean merge_,
			AsyncCallback<Order> callback_);

	public void hasOrderConflict(long sellSessionId_, Order order_,
			AsyncCallback<Boolean> callback_);

	public void save(Stall stall_, AsyncCallback<Void> callback_);

	public void getCustomers(AsyncCallback<List<CustomerDTO>> callback_);

	public void addCustomer(Customer c_, AsyncCallback<Customer> callback_);

	public void removeCustomer(String customerId_, AsyncCallback<Void> callback_);

	public void getOrders(long sellSessionId_,
			AsyncCallback<Collection<Order>> callback_);

	public void generateOrdersReport(long sellSessionId_,
			AsyncCallback<String> callback_);

	public void changePassword(String password_, String newPassword_,
			AsyncCallback<Void> callback_);

	public void setCustomerRole(String customerid_, CustomerRole role_,
			AsyncCallback<Void> callback_);

	void getCustomer(long uuid_, AsyncCallback<Customer> callback);

	void getProductsStartingWith(String prefix,
			AsyncCallback<Product[]> asyncCallback);

	void validateNewProductMarket(NewProductMarket newProductMarket_,
			AsyncCallback<Boolean> callback);

	void addNewProductMarket(NewProductMarket newProductMarket_,
			AsyncCallback<Product> callback);

	void getProductVarities(AsyncCallback<ProductVariety []> callback);

	public void getProductCategories(
			AsyncCallback<ProductCategory []> getProductCatagoriesCallback);

	public void resetPassword(String email,
			AsyncCallback<String> resetPasswordCallback);

	public void getUserStores(String userId,
			AsyncCallback<List<Store>> getUserStoresCallback);

	public void removeStore(Store store_,
			AsyncCallback<Boolean> removeStoreCallback);

	public void isStoreNameExists(String storeName,
			AsyncCallback<Boolean> checkStoreNameCallback);

	public void addStore(Store storeToAdd, 
			AsyncCallback<Store> addStoreCallback);

	public void getStores(LatLng northEastBound, LatLng southWestBound,
			AsyncCallback<List<Store>> getStoreCallback);

	public void save(Store store, AsyncCallback<Void> callback_);

}
